package com.hy.admin.service;

import java.util.List;

import com.hy.admin.helper.response.NewsListResponse;
import org.springframework.web.multipart.MultipartFile;

import com.github.pagehelper.PageInfo;
import com.hy.admin.entity.NewsEntity;
import com.hy.admin.helper.response.NewsResponse;
import com.hy.core.response.ServicesResult;

/**
 * Created by yangqq on 18/4/5.
 */
public interface NewsService {
    /**
     * 查询所有新闻--分页
     * @return
     */
    ServicesResult<List<NewsListResponse>> list(Integer pageNum, Integer pageSize);

    /**
     * 新闻详情
     * @param id
     * @return
     */
    ServicesResult<NewsResponse> detail(Long id);

    /**
     * 添加新闻
     * @param newsEntity
     * @param files
     * @return
     */
    ServicesResult<Boolean> add(NewsEntity newsEntity, MultipartFile[] files) throws Exception;

    /**
     * 修改新闻
     * @param newsEntity
     * @return
     */
    ServicesResult<Boolean> update(NewsEntity newsEntity);
    /**
     * 删除新闻
     * @param ids
     * @return
     */
    ServicesResult<Boolean> delete(String ids) throws Exception;

    /**
     * 设置新闻推荐
     * @param id
     * @return
     */
    ServicesResult<Boolean> updateRecommend(Long id, Integer isRecommend);
    
    /**
     * 根据关键字查询新闻列表
     * <p>Title: listByKeyWord</p>  
     * <p>Description: </p>  
     * @param keyWord
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<NewsEntity> listByKeyWord(String keyWord, Integer pageNum, Integer pageSize);
}
